// init color palette
// visit this page to get palette module https://github.com/gee-community/ee-palettes

// load module
var palettes = require('users/gena/packages:palettes')

// init a palette, you can find the available palette in the above page
var palette = palettes.colorbrewer.RdYlGn[9]
// reverse the direction
var palette_rev = palettes.colorbrewer.RdYlGn[9].reverse()
// use a subset of color palette
var palette_sub = palettes.colorbrewer.RdYlGn[9].slice(3,7)

// use palette in image visualization
// Load some raster data: CONUS mean daily max temperature for January 2010
var tmax = ee.Image('OREGONSTATE/PRISM/AN81m/201001').select('tmax');

// Get a palette: a list of hex strings
var palettes = require('users/gena/packages:palettes');
var palette = palettes.misc.tol_rainbow[7];
 
// Display max temp with defined palette stretched between selected min and max
Map.addLayer(tmax, {min: -11, max: 25, palette: palette}, 'tmax');